package org.example.erp.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 
 * @TableName sales_order
 */
@TableName(value ="sales_order")
@Data
public class SalesOrder implements Serializable {
    /**
     * 编号
     */
    @TableId(type = IdType.AUTO)
    private Integer soId;

    /**
     * 订单编码
     */
    private String salesCode;

    /**
     * 订单名称
     */
    private String salesName;

    /**
     * 客户编码
     */
    private Integer customerId;

    /**
     * 客户PO号
     */
    private String customerPo;

    /**
     * 订货日期
     */

    @JsonFormat(pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date orderDate;

    /**
     * 交货日期
     */

    @JsonFormat(pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date deliveryDate;

    /**
     * 订单类别
     */
    private Integer orderCategory;

    /**
     * 备注
     */
    private String remark;

    /**
     * 订单状态
     */
    private Integer status;

    /**
     * 创建者
     */
    private String createdBy;

    /**
     * 创建时间
     */

    @JsonFormat(pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date createdAt;

    /**
     * 修改者
     */
    private String modifiedBy;

    /**
     * 修改时间
     */
    private Date modifiedAt;

    /**
     * 
     */
    private Integer 列Name;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
    @TableField(exist = false)

    private Customer customer;
    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        SalesOrder other = (SalesOrder) that;
        return (this.getSoId() == null ? other.getSoId() == null : this.getSoId().equals(other.getSoId()))
            && (this.getSalesCode() == null ? other.getSalesCode() == null : this.getSalesCode().equals(other.getSalesCode()))
            && (this.getSalesName() == null ? other.getSalesName() == null : this.getSalesName().equals(other.getSalesName()))
            && (this.getCustomerId() == null ? other.getCustomerId() == null : this.getCustomerId().equals(other.getCustomerId()))
            && (this.getCustomerPo() == null ? other.getCustomerPo() == null : this.getCustomerPo().equals(other.getCustomerPo()))
            && (this.getOrderDate() == null ? other.getOrderDate() == null : this.getOrderDate().equals(other.getOrderDate()))
            && (this.getDeliveryDate() == null ? other.getDeliveryDate() == null : this.getDeliveryDate().equals(other.getDeliveryDate()))
            && (this.getOrderCategory() == null ? other.getOrderCategory() == null : this.getOrderCategory().equals(other.getOrderCategory()))
            && (this.getRemark() == null ? other.getRemark() == null : this.getRemark().equals(other.getRemark()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getCreatedBy() == null ? other.getCreatedBy() == null : this.getCreatedBy().equals(other.getCreatedBy()))
            && (this.getCreatedAt() == null ? other.getCreatedAt() == null : this.getCreatedAt().equals(other.getCreatedAt()))
            && (this.getModifiedBy() == null ? other.getModifiedBy() == null : this.getModifiedBy().equals(other.getModifiedBy()))
            && (this.getModifiedAt() == null ? other.getModifiedAt() == null : this.getModifiedAt().equals(other.getModifiedAt()))
            && (this.get列Name() == null ? other.get列Name() == null : this.get列Name().equals(other.get列Name()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getSoId() == null) ? 0 : getSoId().hashCode());
        result = prime * result + ((getSalesCode() == null) ? 0 : getSalesCode().hashCode());
        result = prime * result + ((getSalesName() == null) ? 0 : getSalesName().hashCode());
        result = prime * result + ((getCustomerId() == null) ? 0 : getCustomerId().hashCode());
        result = prime * result + ((getCustomerPo() == null) ? 0 : getCustomerPo().hashCode());
        result = prime * result + ((getOrderDate() == null) ? 0 : getOrderDate().hashCode());
        result = prime * result + ((getDeliveryDate() == null) ? 0 : getDeliveryDate().hashCode());
        result = prime * result + ((getOrderCategory() == null) ? 0 : getOrderCategory().hashCode());
        result = prime * result + ((getRemark() == null) ? 0 : getRemark().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getCreatedBy() == null) ? 0 : getCreatedBy().hashCode());
        result = prime * result + ((getCreatedAt() == null) ? 0 : getCreatedAt().hashCode());
        result = prime * result + ((getModifiedBy() == null) ? 0 : getModifiedBy().hashCode());
        result = prime * result + ((getModifiedAt() == null) ? 0 : getModifiedAt().hashCode());
        result = prime * result + ((get列Name() == null) ? 0 : get列Name().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", soId=").append(soId);
        sb.append(", salesCode=").append(salesCode);
        sb.append(", salesName=").append(salesName);
        sb.append(", customerId=").append(customerId);
        sb.append(", customerPo=").append(customerPo);
        sb.append(", orderDate=").append(orderDate);
        sb.append(", deliveryDate=").append(deliveryDate);
        sb.append(", orderCategory=").append(orderCategory);
        sb.append(", remark=").append(remark);
        sb.append(", status=").append(status);
        sb.append(", createdBy=").append(createdBy);
        sb.append(", createdAt=").append(createdAt);
        sb.append(", modifiedBy=").append(modifiedBy);
        sb.append(", modifiedAt=").append(modifiedAt);
        sb.append(", 列Name=").append(列Name);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}